/**
 * 
 */
package eu.mrbussy.applications.wickedhrm.gui.editors;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

/**
 * Class that handles the ModifyListener event. Attach a new instance of 
 * this class to any ModifyListener event and the view is automatically turned to dirty.
 * @author R. Middel
 * @since 1.0
 */
class DataModifyListener implements ModifyListener {

	/**
	 * Store this view for later use
	 */
	private SaveablePart parent = null;
	/**
	 * Create an instance for this object
	 * @param 
	 * 		parent reference to the saveablepart where this class must be implemented
	 */
	public DataModifyListener(SaveablePart parent) {
		this.parent = parent;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.swt.events.ModifyListener#modifyText()
	 */
	@Override
	public void modifyText(ModifyEvent e) {
		parent.setDirty();
	}	
}
